// 保养类型状态控制
export function getctOrderTypes(data) {
	switch (data) {
		case 1:
			return "常规保养";
		case 2:
			return "一般维修";
		case 3:
			return "整备维修";
		case 4:
			return "事故维修";
	}
};

// tab状态控制
export function getStatus1(data) {
	switch (data) {
		case "0":
			return "预约单";
		case "1":
			return "待编辑";
		case "2":
			return "平台待审核";
		case "3":
			return "车管待审核";
		case "4":
			return "合约单位待审核";
		case "5":
			return "施工中";
		case "6":
			return "待视频检查";
		case "7":
			return "待转结算";
		case "8":
			return "转结算待车管审核";
			// return "转结算待审核";
		case "9":
			return "已结算";
		case "10":
			return "已结算 ";
		case "11":
			return "已结算";
		case "12":
			return "转结算待合约单位总部审核";
		case "-41":
			return "资产专员审核";
		case "-42":
			return "资产总监审核";
		case "-43":
			return "资产总经理审核";
		case "81":
			return "资产整备审核专员审核";
		case "82":
			return "资产事故审核专员审核";
		case "21":
			return "麦卡开单审核";
		case "51":
			return "麦卡取车审核";
	}
};


export function getStatus2(data) {
	switch (data) {
		case "0":
			return "预约单";
		case "3":
			return "车管待确认";
		case "4":
			return "车管确认";
	}
};

// 审核记录状态
export function VehicleStatus(data) {
	switch (data) {
		case "2":
			return "平台待审核"
		case "3":
			return "车管待审核 "
		case "4":
			return "合约单位待审核"
		case "5":
			return "审核通过";
		case "6":
			return "审核通过";
		case "7":
			return "审核通过";
		case "8":
			return "审核通过";
		case "9":
			return "审核通过";
		case "10":
			return "审核通过";
		case "11":
			return "审核通过";
		case "-41":
			return "资产专员审核";
		case "-42":
			return "资产总监审核";
		case "-43":
			return "资产总经理审核";
		case "81":
			return "资产整备审核专员审核";
		case "82":
			return "资产事故审核专员审核";
		case "21":
			return "麦卡开单审核";
		case "51":
			return "麦卡取车审核";

	}
}


// 选择通过or不通过状态控制
export function radioStatus(data) {
	if (data == 1) {
		return "通过"
	} else {
		return "不通过"
	}
}


export function settlementMethod1(data) {
	if (data == 1) {
		return '司机自付'

	} else if (data == 2) {
		return '合约单位代付'
	}
}

export function settlementMethod2(data) {
	if (data == 1) {
		return '保险公司直赔'

	} else if (data == 2) {
		return '麦卡代收代付'
	}
}

export function responsibilityTypeData(data) {
	if (data == 1) {
		return '有责'

	} else if (data == 2) {
		return '无责'
	}
}

export function returnVehicleType(data) {
	if (data == 1) {
		return '否'

	} else if (data == 2) {
		return '是'
	}
}

// 截取年月日
export function formatTime(date) {
	// 将日期以空格隔开，即['2020-06-13', '17:10:09']
	date = (date + '').split(/[ ]+/);
	let result = [];
	let reg = /^(\d{4})-(\d{1,2})-(\d{1,2})$/;
	// 用截取出来的年月日进行正则表达式匹配
	reg.exec(date[0]);
	result.push(RegExp.$1); //获取匹配到的第一个子匹配，即‘2020’
	result.push(RegExp.$2);
	result.push(RegExp.$3);
	return result.join("-");
}